#include <bits/stdc++.h>
using namespace std;
using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using i128=__int128;
const int N=1e6+5;

void solve(){
    
    return;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    cin>>n;
    string s;
    cin>>s;
    int l,r,maxn=0;
    for(int i=0;i<n;i++){
        if(s[i]=='/'){
            l=i-1;r=i+1;
            while(s[l]-'0'+1==s[r]-'0'){
                l--;r++;
            }
            maxn=max(maxn,r-l-1);
        }
    }
    cout<<maxn<<endl;
    

    return 0;
}